package com.cloudlinkscm.loms.services.base.notify.controller;

import com.cloudlinkscm.loms.framework.core.pojo.RestfulApiResponse;
import com.cloudlinkscm.loms.services.base.notify.dto.email.EmailMessageDto;
import com.cloudlinkscm.loms.services.base.notify.dto.SendResultDto;
import com.cloudlinkscm.loms.services.base.notify.service.NotificationService;
import com.cloudlinkscm.loms.services.base.notify.service.EmailRemoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : tac
 * @date : 2017/6/14
 */

@RestController
@RequestMapping(EmailRemoteService.PATH)
public class EmailMessageController implements EmailRemoteService {
    @Autowired
    private NotificationService notificationService;

    @Override
    public RestfulApiResponse<SendResultDto> sendEmail(@RequestBody EmailMessageDto emailMessageDto) {
        return RestfulApiResponse.success(notificationService.sendEmail(emailMessageDto));
    }
}
